<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img
        class="banner-img"
        :src="bannerData.bannerImg"
        :alt="bannerData.sightName"
      />
      <div class="banner-info">
        <div class="bannner-number">
          <span class="iconfont back-icon">&#xeb9a;</span>
          <em>15</em>
        </div>
        <div class="banner-title">{{ bannerData.sightName }}</div>
      </div>
    </div>
    <fade-animation>
      <common-gallary
        :imgs="bannerData.gallaryImgs"
        v-if="showGallary"
        @close="handleBannerClose"
      ></common-gallary>
    </fade-animation>
  </div>
</template>

<script>
import CommonGallary from "@/common/gallary/Gallary";
import FadeAnimation from "@/common/fade/FadeAnimation";
export default {
  name: "DetailBanner",
  props: {
    bannerData: Object
  },
  components: {
    CommonGallary,
    FadeAnimation
  },
  data() {
    return {
      showGallary: false
    };
  },
  methods: {
    handleBannerClick() {
      this.showGallary = true;
    },
    handleBannerClose() {
      this.showGallary = false;
    }
  }
};
</script>
<style lang="stylus" scoped>
.banner {
  overflow: hidden
  height: 0
  padding-bottom: 55%
  position: relative
  .banner-img {
    width: 100%
  }
  .banner-info {
    color: #fff
    display: flex
    flex-direction: column
    position: absolute
    left: 0.2rem
    right: 0
    bottom: 0.2rem
    line-height: 0.6rem
    .banner-title {
      // flex: column
      font-size: 0.36rem
    }
    .bannner-number {
      font-size: 0.24rem
      text-align: center
      box-sizing: border-box
      width: 1.2rem
      height: 0.4rem
      line-height: 0.4rem
      border-radius: 0.2rem
      background: rgba(0, 0, 0, 0.8)
    }
  }
}
</style>
